<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript">
$(document).ready(function(){
$("#view_origin").hide();
$("#r_uploadFile").attr("src","${initParam.imgRoot}${sessionScope.recipeContent.list[reviewOrder-1].r_img_new}");

//다음버튼
$("#main_arrow_next").click(function(){
	if(${requestScope.orderSize==requestScope.reviewOrder}){
		alert("마지막 페이지 입니다");
		return false;
	}else{
		$(":hidden[name=pageNo]").val($("#now_pageNo").text());
		$("#pForm_4").submit();
	}
});
//이전버튼
$("#main_arrow_prev").click(function(){
	if(${requestScope.reviewOrder==1}){
		location.href="recipe.do?command=getTodayCook&page=3&reply_flag="+$("#reply_flag").val()+"&pageNo="+$("#now_pageNo").text();
	}else{
		location.href="recipe.do?command=getAnotherAndTodayDescContent&page=prev&reply_flag="+$("#reply_flag").val()+"&pageNo="+$("#now_pageNo").text();
	}
});
//수정버튼
$("#main_cancle").click(function(){
	if(confirm("수정 하시겠습니까?")){
		location.href="recipe.do?command=update_move&page=4";
	}
});
//삭제버튼
$("#main_ok").click(function(){
	 if(confirm("이 게시물을 삭제하시겠습니까?")){
	    location.href="recipe.do?command=delete&r_no=${sessionScope.recipeContent.rvo.r_no}";
	 }
});
//이미지 클릭시 레이어팝업으로 원본이미지 띄우기
$("#r_uploadFile").click(function(){
	$("#view_origin").show();
});
//레이어팝업 이미지 클릭시 hide
$("#img_origin").click(function(){
	$("#view_origin").hide();
});
});
	
</script>    
<div id="write_container">
<!-- 공통부분 -->
<div id="main_page1"><img src="${initParam.root }/img/main/main-write4-ing.gif"></div>
<div id="main_arrow_prev"><input type="image" src="${initParam.root }/img/main/main-write-prev.gif"></div>
<div id="main_arrow_next"><input type="image" src="${initParam.root }/img/main/main-write-next.gif"></div>

<c:if test="${sessionScope.recipeContent.rvo.m_id==sessionScope.loginMember.mvoLogin.m_id}">
<div id="main_cancle"><input type="image" src="${initParam.root }/img/main/main-update-btn.gif"></div>
<div id="main_ok"><input type="image" src="${initParam.root }/img/main/main-delete-btn.gif"></div>
</c:if>
<!-- 여기부턴 이 페이지에서만 쓰임 -->

<div id="main_confirm"><input type="text" id="main_confirm_text" value="${requestScope.reviewOrder+3}" readonly="readonly"></div>
	<div id="main_write_form">
		<!-- 데이터 전송용 폼 -->
 		<form id="pForm_4" action="recipe.do" method="post">
 			<input type="hidden" name="command" value="getAnotherAndTodayDescContent">
 			<input type="hidden" name="page" value="next">
 			<input type="hidden" name="pageNo" value="">
 			<input id="reply_flag" type="hidden" name="reply_flag" value="${requestScope.reply_flag}">
 			<div id="main_title"><input type="text" id="main_subject_text" name="r_subject" value="${sessionScope.recipeContent.list[reviewOrder-1].r_subject}" readonly style="border: none; text-align: center;"/></div>
 			<div id="main_img" align="center"><img src="${initParam.root }/img/main/main-write-img.jpg" name="r_uploadFile" id="r_uploadFile" style="cursor: pointer;"></div>
 			<div id="main_comment"><pre><textarea id="main_content_text" cols="70" rows="7" name="r_content" readonly style="border: none; text-align: center;">${sessionScope.recipeContent.list[reviewOrder-1].r_content}</textarea></pre></div>
		 </form>
 	</div>
</div>
<div id="view_origin" align="center"  style="position: absolute; width:1024px; top:10px; vertical-align:middle;">
	<img src="${initParam.imgRoot }${sessionScope.recipeContent.list[reviewOrder-1].r_img_origin}"  style="max-width:1024px; height:768px; width: auto; cursor: pointer;" id="img_origin">
</div>